From: Isaku Yamahata Date: Fri, 12 Dec 2008 01:34:18 +0000 (+0900) Subject: IA64: fix fp fault/trap handler. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14032 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=7dde2351e51d26088e0ab3951dfaa311994e9114;p=xen.git IA64: fix fp fault/trap handler. This patch is a part of fixes to bug reported as http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392 When fpswa handler fails to get a bundle in guest, fp fault/trap should be injected into the guest and let a guest to handle it. When the fpswa library return a error, there is no way to pass the value to the guest. In that case, just inject fpswa fault/trap into a guest running a risk that guest may get error with their own fpswa call. Here it is assumed that no applications depend on SIGFP process signal to recover their computation. Signed-off-by: Isaku Yamahata --- diff --git a/xen/arch/ia64/vmx/vmx_fault.c b/xen/arch/ia64/vmx/vmx_fault.c index 586e6925f2..53d0693876 100644 --- a/xen/arch/ia64/vmx/vmx_fault.c +++ b/xen/arch/ia64/vmx/vmx_fault.c @@ -122,8 +122,7 @@ void vmx_reflect_interruption(u64 ifa, u64 isr, u64 iim, if (!status) { vcpu_increment_iip(vcpu); return; - } else if (IA64_RETRY == status) - return; + } break; case 33: // IA64_FP_TRAP_VECTOR @@ -133,10 +132,6 @@ void vmx_reflect_interruption(u64 ifa, u64 isr, u64 iim, status = handle_fpu_swa(0, regs, isr); if (!status) return; - else if (IA64_RETRY == status) { - vcpu_decrement_iip(vcpu); - return; - } break; case 29: // IA64_DEBUG_VECTOR diff --git a/xen/arch/ia64/xen/faults.c b/xen/arch/ia64/xen/faults.c index a32c3c6daf..d1327e8681 100644 --- a/xen/arch/ia64/xen/faults.c +++ b/xen/arch/ia64/xen/faults.c @@ -314,7 +314,6 @@ fp_emulate(int fp_fault, void *bundle, unsigned long *ipsr, unsigned long handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr) { - struct vcpu *v = current; IA64_BUNDLE bundle; unsigned long fault_ip; fpswa_ret_t ret; @@ -348,7 +347,6 @@ handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr) &isr, ®s->pr, ®s->cr_ifs, regs); if (ret.status) { - PSCBX(v, fpswa_ret) = ret; printk("%s(%s): fp_emulate() returned %ld\n", __FUNCTION__, fp_fault ? "fault" : "trap", ret.status); } @@ -688,9 +686,6 @@ ia64_handle_reflection(unsigned long ifa, struct pt_regs *regs, vcpu_increment_iip(v); return; } - // fetch code fail - if (IA64_RETRY == status) - return; printk("ia64_handle_reflection: handling FP fault\n"); vector = IA64_FP_FAULT_VECTOR; break; @@ -698,11 +693,6 @@ ia64_handle_reflection(unsigned long ifa, struct pt_regs *regs, status = handle_fpu_swa(0, regs, isr); if (!status) return; - // fetch code fail - if (IA64_RETRY == status) { - vcpu_decrement_iip(v); - return; - } printk("ia64_handle_reflection: handling FP trap\n"); vector = IA64_FP_TRAP_VECTOR; break; diff --git a/xen/include/asm-ia64/domain.h b/xen/include/asm-ia64/domain.h index 43e4691a7a..2c9f21f089 100644 --- a/xen/include/asm-ia64/domain.h +++ b/xen/include/asm-ia64/domain.h @@ -288,7 +288,6 @@ struct arch_vcpu { char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI char hypercall_continuation; - fpswa_ret_t fpswa_ret; /* save return values of FPSWA emulation */ struct timer hlt_timer; struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */